package com.atguigu.mycloud.controller;

import com.atguigu.mycloud.Enum.ReturnMessage;
import com.atguigu.mycloud.entity.PayDTO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author 任浩
 * @version 1.0
 */

@RestController
public class OrderController {
    private static final String url = "http://cloud-payment-service";
    @Resource
    private RestTemplate restTemplate;

    @GetMapping("/consumer/pay/get/{id}")
    public ReturnMessage get(@PathVariable("id") Integer id) {
        return restTemplate.getForObject(url + "/pay/get/" + id, ReturnMessage.class);
    }
}
